package cate.game.pvp.gradepvp.msg;

import cate.common.table.d.GDGradePvp;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBGradePvp;
import cate.game.role.Role;
import cate.game.role.pvp.gradepvp.GradePvpMark;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "全服段位赛战绩结果 の 返回")
public class GradePvpMarkResp implements MsgOutput {
    @NoteField(value = "战绩数据")
    public GradePvpMark data;

    public GradePvpMarkResp() {

    }

    public GradePvpMarkResp(Role role, int type) {
        data = type == GDGradePvp.MARK_TYPE_PRESENT
                        ? role.getPvp().gradePvp.present
                        : role.getPvp().gradePvp.total;
        data.calcMvpHeroTid();
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBGradePvp.MARK_DATA_RESP;
    }
}
